package gui.lesson01;

import java.awt.*;

public class TestGridLayout {
    public static void main(String[] args) {
        //东西南北中布局
        Frame frame = new Frame("TestGridLayout");
        Button button0 = new Button("button0");
        Button button1 = new Button("button1");
        Button button2 = new Button("button2");
        Button button3 = new Button("button3");
        Button button4 = new Button("button4");
        Button button5 = new Button("button5");
        //三行两列
        frame.setLayout(new GridLayout(3,2));
        frame.add(button0);
        frame.add(button1);
        frame.add(button2);
        frame.add(button3);
        frame.add(button4);
        frame.add(button5);
        //java函数自动适配大小
        frame.pack();
        frame.setSize(400,400);
        frame.setVisible(true);
    }
}
